import superRequest from '@/utils/http/index'
import { IDataType } from '@/utils/http/types'

/** 获取部门树(接口) */
export const apiGetDeptTree = async () => {
  return await superRequest.get<IDataType>({
    url: '/dept/tree',
  })
}

/** 部门列表(接口) */
export const apiDeptList = async (data: any) => {
  return await superRequest.post<IDataType>({
    url: '/dept/list',
    data,
  })
}

/** 部门新增(接口) */
export const apiDeptAdd = async (data: any) => {
  return await superRequest.post<IDataType>({
    url: '/dept/add',
    data,
  })
}

/** 部门修改(接口) */
export const apiDeptUpdate = async (data: any) => {
  return await superRequest.post<IDataType>({
    url: '/dept/update',
    data,
  })
}

/** 部门删除(接口) */
export const apiDeptDelete = async (data: any) => {
  return await superRequest.post<IDataType>({
    url: '/dept/delete',
    data,
  })
}
